﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="RecipeDetails.aspx.vb" Inherits="LondonItalianRestaurants.RecipeDetails" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />
    Repice Information<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
    DataSourceID="SqlDataSource1" Height="50px" Width="91%" CssClass="recipe">
    <FieldHeaderStyle BackColor="#FF3399" Font-Bold="True" />
    <Fields>
        <asp:BoundField DataField="RecipeName" HeaderText="RecipeName" 
            SortExpression="RecipeName" />
        <asp:BoundField DataField="CookTime" HeaderText="CookTime" 
            SortExpression="CookTime" />
        <asp:BoundField DataField="Serves" HeaderText="Serves" 
            SortExpression="Serves" />
        <asp:BoundField DataField="Difficulty" HeaderText="Difficulty" 
            SortExpression="Difficulty" />
        <asp:BoundField DataField="Ingredients" HeaderText="Ingredients" 
            SortExpression="Ingredients" />
        <asp:BoundField DataField="CookingSteps" HeaderText="CookingSteps" 
            SortExpression="CookingSteps" />
        <asp:BoundField DataField="AddedBy" HeaderText="AddedBy" 
            SortExpression="AddedBy" />
        <asp:TemplateField HeaderText="Michelin Stars" SortExpression="MichelinStars">
            <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MichelinStars") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                    <b> 

                        <asp:Label ID="Label1" runat="server" ForeColor="blue" Font-Size="X-Large"  Text='<%# ShowStars(Eval("MichelinStars")) %>'></asp:Label></b>
                    </ItemTemplate>
                </asp:TemplateField>
        <asp:ImageField DataAlternateTextField="RecipePicture" 
            DataImageUrlField="RecipePicture" HeaderText="Image">
            <ControlStyle CssClass="recpic" />
        </asp:ImageField>
    </Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    SelectCommand="SELECT [RecipeName], [CookTime], [Serves], [Difficulty], [Ingredients], [CookingSteps], [AddedBy], [MichelinStars], [RecipePicture] FROM [UserRecipe] WHERE ([ID] = ?)">
    <SelectParameters>
        <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
    <br />
    <asp:Rating ID="Rating2" runat="server" EmptyStarCssClass="empty" FilledStarCssClass="blue" StarCssClass="blue" WaitingStarCssClass="waitingblue">
    </asp:Rating>
    <br />
    <br />
    <asp:Button ID="btn_rating" runat="server" Text="Submit Rating" />  
    <br />
    <br />
    <br />
    <asp:Button ID="btn_like" runat="server" Height="26px" Text="Like" 
            Width="54px" />
        <asp:Image ID="img_like" runat="server" Height="61px" 
            ImageUrl="~/Pictures/like1.png" Width="71px" />
    <br />
     <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Title:&nbsp;tle:&nbsp;</p>
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="tb_Title" runat="server" Width="541px" CssClass="table" 
        Height="35px"></asp:TextBox>
    <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Comments:</p>
    
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="tb_CommentBody" runat="server" Height="205px" 
            TextMode="MultiLine" Width="547px" CssClass="table"></asp:TextBox>
    <p>
        <asp:Button ID="btn_Comment" runat="server" Text="Add Comment" Width="120px" />

         <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource2" CssClass="table" Width="100%" 
            DataKeyNames="ID">
            <Columns>
                <asp:BoundField DataField="Author" HeaderText="Author" 
                    SortExpression="Author" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="CommentBody" HeaderText="CommentBody" 
                    SortExpression="CommentBody" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Author], [Title], [CommentBody], [ID] FROM [RecipeComments] WHERE ([Recipe_fkid] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Recipe_fkid" QueryStringField="ID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    <p>
    <br />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <br />
     <br />
    <br />
    <br />
    
</asp:Content>
